<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet/less" type="text/css" href="style.less" />
    <link rel="stylesheet" href="../common/css/coommon.css" />
    <style>
      .button_primary_empty {
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .button_primary_empty img {
        margin-right: 3px;
      }
    </style>
  </head>
  <body>
    <div class="common zysp" id="app">
      <div class="card_01">
        <!-- <div class="qr-code">
          <img />
        </div> -->
        <p class="title">
          <span><img src="./img/icon01.png" />申请增项</span>
          <button class="button_primary">返回</button>
        </p>
        <ul class="desc">
          <li style="width: 100%">
            <span>项目名称</span>项目名称项目名称项目名称
          </li>
          <li style="width: 100%"><span>申请人</span>练清风</li>
          <li style="width: 100%"><span>申请时间</span>2023/01/12 13:24:56</li>
          <li style="align-items: flex-start">
            <span>审核人</span>
            <div>
              一级审核人：某某<br />
              二级审核人：某某<br />
              三级审核人：某某
            </div>
          </li>
          <li style="width: 100%">
            <span>收货地址</span>
            <div class="input-group">
              <input placeholder="请输入收货地址" style="width: 64vw" />
            </div>
          </li>
          <li style="width: 100%">
            <span>关联合同</span>
            <div class="input-group">
              <input placeholder="" style="width: 64vw" />
              <button
                style="transform: translateX(-130%)"
                class="button_primary_text button_link"
              >
                选择合同
              </button>
            </div>
          </li>
        </ul>
        <br />
        <div class="table">
          <div class="table-header">
            <div class="tr">
              <div class="td" style="width: 20%">文件类型</div>
              <div class="td center" style="width: 20%">是否必传</div>
              <div class="td center" style="width: 20%">上传人</div>
              <div class="td center" style="width: 20%">上传文件预览</div>
              <div class="td center" style="width: 20%">操作</div>
            </div>
          </div>
          <div class="table-body">
            <div class="tr" v-for="item in 5">
              <div class="td" style="width: 20%">终验报告</div>
              <div class="td center" style="width: 20%">是</div>
              <div class="td center" style="width: 20%">张三</div>
              <div class="td center" style="width: 20%">
                <button class="button_primary_text">总验报告.doc</button>
              </div>
              <div class="td center" style="width: 20%">
                <button class="button_error_text">删除</button>
              </div>
            </div>
          </div>
          <div class="pageTotal">
            <div class="pagination">
              <span>共 {{total}} 条</span>
              <ul>
                <li @click="shang"><i class="bi bi-chevron-left"></i></li>
                <li
                  v-show="start > 0"
                  @click="()=>{
                      if(start > 0){
                        params.page = start;
                        end-=3
                        start-=3
                      }
                    }"
                >
                  ...
                </li>
                <li
                  @click="onCurrentPage(item)"
                  v-for="item in totalPage"
                  v-show="item < end && item > start"
                  :class="[item == params.page ? 'active' :'']"
                >
                  {{item}}
                </li>
                <li
                  v-show="end <= totalPage"
                  @click="()=>{
                      if(end <= totalPage){
                      params.page = end;
                      end+=3
                      start+=3
                      }
                    }"
                >
                  ...
                </li>
                <li @click="next"><i class="bi bi-chevron-right"></i></li>
              </ul>
            </div>
          </div>
        </div>
        <button class="button_primary_empty">
          <img src="./img/icon04.png" /> 添加
        </button>
        <br />
        <div class="descriptions" style="width: 50vw">
          <div class="span" style="width: 50%">报价合计</div>
          <div
            class="span"
            style="width: 50%; justify-content: flex-end; padding-right: 20px"
          >
            0.00
          </div>
          <div class="span" style="width: 50%">最终报价合计</div>
          <div
            class="span"
            style="width: 50%; justify-content: flex-end; padding-right: 20px"
          ></div>
          <div class="span" style="width: 50%">金额限定占比</div>
          <div
            class="span"
            style="width: 50%; justify-content: flex-end; padding-right: 20px"
          >
            0.3% / 0.5% /1%
          </div>
        </div>
        <br />
        <div style="display: flex; justify-content: flex-end">
          <button class="button_primary_empty">取消</button>
          &ensp;
          <button class="button_primary_plain">保存</button>
          &ensp;
          <button class="button_primary">提交审批</button>
        </div>
      </div>
    </div>
  </body>
  <script src="./less.js"></script>
  <script src="../common/js/vue.js"></script>
  <script>
    const { createApp } = Vue;
    createApp({
      data() {
        return {
          total: 100,
          totalPage: 10,
          start: 0,
          end: 4,
          list: [],
          params: {
            page: 1,
            limit: 10,
          },
        };
      },
      //所有函数都写在这里
      methods: {
        // 列表状态切换
        statusChange(item, index) {
          this.statusActive = index;
        },
        shang() {
          if (this.params.page > 1) this.params.page--;
          if (this.params.page < this.start + 1) {
            this.end -= 3;
            this.start -= 3;
          }
          this.get();
        },
        next() {
          if (this.params.page < this.totalPage) this.params.page++;
          if (this.params.page > this.end - 1) {
            this.end += 3;
            this.start += 3;
          }
          this.get();
        },
        onCurrentPage(page) {
          this.params.page = page;
        },
        //接口
        get() {
          // ajax 请求
          // $.ajax()
          this.totalPage = 10; // 总页数
          this.total = 100; //总条数
          this.list = [
            {
              value: "吴恒",
            },
          ];
        },
      },
    }).mount("#app");
  </script>
</html>
